//#define __DEBUG__
// by Xeno
#define THIS_FILE "fn_remabox.sqf"
#include "x_setup.sqf"

private ["_boxes", "_mname", "_bpos"];
PARAMS_1(_bpos);
if (typeName _bpos == "SCALAR") exitWith {};
_boxes = __XJIPGetVar(GVAR(ammo_boxes));
{
	if ((_x select 0) distance _bpos < 5) exitWith {
		_mname = _x select 1;
		deleteMarker _mname;
		_boxes set [_forEachIndex, -1];
	};
} forEach _boxes;
_boxes = _boxes - [-1];
[QGVAR(ammo_boxes), _boxes] call FUNC(NetSetJIP);